home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_msql.idb / usr / freeware / catman / u_man / cat1 / mkdepend.Z / mkdepend
Encoding:
Text File  |  1998-10-28  |  13.0 KB  |  266 lines

  1. /xlv1/freeware/1998.Oct/msql/2.0.3/msql-2.0.3.diffbuild/src/makedepend
  2.  
  3.  
  4.  
  5.      MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666))))     MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))
  6.  
  7.  
  8.  
  9.      NNNNAAAAMMMMEEEE
  10.       makedepend - create dependencies in makefiles
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd [ ----DDDDnnnnaaaammmmeeee====ddddeeeeffff ] [ ----DDDDnnnnaaaammmmeeee ] [ ----IIIIiiiinnnncccclllluuuuddddeeeeddddiiiirrrr ]    [
  14.       ----YYYYiiiinnnncccclllluuuuddddeeeeddddiiiirrrr ] [ ----aaaa ]    [ ----ffffmmmmaaaakkkkeeeeffffiiiilllleeee ] [ ----oooooooobbbbjjjjssssuuuuffffffffiiiixxxx ] [
  15.       ----ppppoooobbbbjjjjpppprrrreeeeffffiiiixxxx ]    [ ----ssssssssttttrrrriiiinnnngggg ] [ ----wwwwwwwwiiiiddddtttthhhh ] [ ----vvvv ]    [ ----mmmm ] [ --
  16.       ooootttthhhheeeerrrrooooppppttttiiiioooonnnnssss -- ] sourcefile ...
  17.  
  18.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.       MMMMaaaakkkkeeeeddddeeeeppppeeeennnndddd reads each    _s_o_u_r_c_e_f_i_l_e in sequence and parses it
  20.       like a C-preprocessor, processing all    #_i_n_c_l_u_d_e, #_d_e_f_i_n_e,
  21.       #_u_n_d_e_f, #_i_f_d_e_f, #_i_f_n_d_e_f, #_e_n_d_i_f, #_i_f and #_e_l_s_e directives so
  22.       that it can correctly    tell which #_i_n_c_l_u_d_e, directives    would
  23.       be used in a compilation.  Any #_i_n_c_l_u_d_e, directives can
  24.       reference files having other #_i_n_c_l_u_d_e    directives, and
  25.       parsing will occur in    these files as well.
  26.  
  27.       Every    file that a _s_o_u_r_c_e_f_i_l_e includes, directly or
  28.       indirectly, is what mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd calls a "dependency".    These
  29.       dependencies are then    written    to a _m_a_k_e_f_i_l_e in such a    way
  30.       that mmmmaaaakkkkeeee((((1111)))) will know which object files must be recompiled
  31.       when a dependency has    changed.
  32.  
  33.       By default, mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd places    its output in the file named
  34.       _m_a_k_e_f_i_l_e if it exists, otherwise _M_a_k_e_f_i_l_e. An    alternate
  35.       makefile may be specified with the ----ffff    option.     It first
  36.       searches the makefile    for the    line
  37.  
  38.           #    DO NOT DELETE THIS LINE    -- make    depend depends on it.
  39.  
  40.       or one provided with the ----ssss option, as a delimiter for the
  41.       dependency output.  If it finds it, it will delete
  42.       everything following this to the end of the makefile and put
  43.       the output after this    line.  If it doesn't find it, the
  44.       program will append the string to the    end of the makefile
  45.       and place the    output following that.    For each _s_o_u_r_c_e_f_i_l_e
  46.       appearing on the command line, mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd puts lines in the
  47.       makefile of the form
  48.  
  49.            sourcefile.o: dfile ...
  50.  
  51.       Where    "sourcefile.o" is the name from    the command line with
  52.       its suffix replaced with ".o", and "dfile" is    a dependency
  53.       discovered in    a #_i_n_c_l_u_d_e directive while parsing _s_o_u_r_c_e_f_i_l_e
  54.       or one of the    files it included.
  55.  
  56.      EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  57.       Normally, mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd will be used in a makefile target so
  58.       that typing "make depend" will bring the dependencies    up to
  59.       date for the makefile.  For example,
  60.           SRCS = file1.c file2.c ...
  61.  
  62.  
  63.  
  64.      Page 1                          (printed 6/9/98)
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.      MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666))))     MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))
  72.  
  73.  
  74.  
  75.           CFLAGS = -O -DHACK -I../foobar -xyz
  76.           depend:
  77.               makedepend -- $(CFLAGS) -- $(SRCS)
  78.  
  79.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  80.       MMMMaaaakkkkeeeeddddeeeeppppeeeennnndddd will ignore any option that it does not
  81.       understand so    that you may use the same arguments that you
  82.       would    for cccccccc((((1111))))....
  83.  
  84.       ----DDDDnnnnaaaammmmeeee====ddddeeeeffff oooorrrr    ----DDDDnnnnaaaammmmeeee
  85.            Define.    This places a definition for _n_a_m_e in
  86.            mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd''''ssss symbol table.  Without =_d_e_f    the symbol
  87.            becomes defined as "1".
  88.  
  89.       ----IIIIiiiinnnncccclllluuuuddddeeeeddddiiiirrrr
  90.            Include directory.  This    option tells mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd    to
  91.            prepend _i_n_c_l_u_d_e_d_i_r to its list of directories to    search
  92.            when it encounters a #_i_n_c_l_u_d_e directive.     By default,
  93.            mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd only searches    the standard include
  94.            directories (usually /usr/include and possibly a
  95.            compiler-dependent directory).
  96.  
  97.       ----YYYYiiiinnnncccclllluuuuddddeeeeddddiiiirrrr
  98.            Replace all of the standard include directories with
  99.            the single specified include directory; you can omit
  100.            the _i_n_c_l_u_d_e_d_i_r to simply    prevent    searching the standard
  101.            include directories.
  102.  
  103.       ----aaaa   Append the dependencies to the end of the file instead
  104.            of replacing them.
  105.  
  106.       ----ffffmmmmaaaakkkkeeeeffffiiiilllleeee
  107.            Filename.  This allows you to specify an    alternate
  108.            makefile    in which mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd can    place its output.
  109.  
  110.       ----oooooooobbbbjjjjssssuuuuffffffffiiiixxxx
  111.            Object file suffix.  Some systems may have object files
  112.            whose suffix is something other than ".o".  This    option
  113.            allows you to specify another suffix, such as ".b" with
  114.            -_o._b or ":obj" with -_o:_o_b_j and so forth.
  115.  
  116.       ----ppppoooobbbbjjjjpppprrrreeeeffffiiiixxxx
  117.            Object file prefix.  The    prefix is prepended to the
  118.            name of the object file.    This is    usually    used to
  119.            designate a different directory for the object file.
  120.            The default is the empty    string.
  121.  
  122.       ----ssssssssttttrrrriiiinnnngggg
  123.            Starting    string delimiter.  This    option permits you to
  124.            specify a different string for mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd to look for
  125.            in the makefile.
  126.  
  127.  
  128.  
  129.  
  130.      Page 2                          (printed 6/9/98)
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.      MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666))))     MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))
  138.  
  139.  
  140.  
  141.       ----wwwwwwwwiiiiddddtttthhhh
  142.            Line width.  Normally, mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd will ensure that
  143.            every output line that it writes    will be    no wider than
  144.            78 characters for the sake of readability.  This    option
  145.            enables you to change this width.
  146.  
  147.       ----vvvv   Verbose operation.  This    option causes mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd to
  148.            emit the    list of    files included by each input file on
  149.            standard    output.
  150.  
  151.       ----mmmm   Warn about multiple inclusion.  This option causes
  152.            mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd to produce a warning if any input file
  153.            includes    another    file more than once.  In previous
  154.            versions    of mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd this was the default behavior;
  155.            the default has been changed to better match the
  156.            behavior    of the C compiler, which does not consider
  157.            multiple    inclusion to be    an error.  This    option is
  158.            provided    for backward compatibility, and    to aid in
  159.            debugging problems related to multiple inclusion.
  160.  
  161.       -------- ooooppppttttiiiioooonnnnssss --------
  162.            If mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd encounters    a double hyphen    (--) in    the
  163.            argument    list, then any unrecognized argument following
  164.            it will be silently ignored; a second double hyphen
  165.            terminates this special treatment.  In this way,
  166.            mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd can be made to safely    ignore esoteric
  167.            compiler    arguments that might normally be found in a
  168.            CFLAGS mmmmaaaakkkkeeee macro (see the EEEEXXXXAAAAMMMMPPPPLLLLEEEE section above).  All
  169.            options that mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd recognizes and appear between
  170.            the pair    of double hyphens are processed    normally.
  171.  
  172.      AAAALLLLGGGGOOOORRRRIIIITTTTHHHHMMMM
  173.       The approach used in this program enables it to run an order
  174.       of magnitude faster than any other "dependency generator" I
  175.       have ever seen.  Central to this performance are two
  176.       assumptions:    that all files compiled    by a single makefile
  177.       will be compiled with    roughly    the same -_I and    -_D options;
  178.       and that most    files in a single directory will include
  179.       largely the same files.
  180.  
  181.       Given    these assumptions, mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd expects to be called
  182.       once for each    makefile, with all source files    that are
  183.       maintained by    the makefile appearing on the command line.
  184.       It parses each source    and include file exactly once,
  185.       maintaining an internal symbol table for each.  Thus,    the
  186.       first    file on    the command line will take an amount of    time
  187.       proportional to the amount of    time that a normal C
  188.       preprocessor takes.  But on subsequent files,    if it
  189.       encounter's an include file that it has already parsed, it
  190.       does not parse it again.
  191.  
  192.       For example, imagine you are compiling two files, _f_i_l_e_1._c
  193.  
  194.  
  195.  
  196.      Page 3                          (printed 6/9/98)
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.      MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))     XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666))))     MMMMAAAAKKKKEEEEDDDDEEEEPPPPEEEENNNNDDDD((((1111))))
  204.  
  205.  
  206.  
  207.       and _f_i_l_e_2._c, they each include the header file _h_e_a_d_e_r._h, and
  208.       the file _h_e_a_d_e_r._h in turn includes the files _d_e_f_1._h and
  209.       _d_e_f_2._h. When you run the command
  210.  
  211.           makedepend file1.c file2.c
  212.  
  213.       mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd will parse    _f_i_l_e_1._c    and consequently, _h_e_a_d_e_r._h and
  214.       then _d_e_f_1._h and _d_e_f_2._h. It then decides that the
  215.       dependencies for this    file are
  216.  
  217.           file1.o: header.h    def1.h def2.h
  218.  
  219.       But when the program parses _f_i_l_e_2._c and discovers that it,
  220.       too, includes    _h_e_a_d_e_r._h, it does not parse the    file, but
  221.       simply adds _h_e_a_d_e_r._h,    _d_e_f_1._h and _d_e_f_2._h to the list of
  222.       dependencies for _f_i_l_e_2._o.
  223.  
  224.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  225.       cc(1), make(1)
  226.  
  227.      BBBBUUUUGGGGSSSS
  228.       mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd parses, but does not currently evaluate, the SVR4
  229.       #predicate(token-list) preprocessor expression; such
  230.       expressions are simply assumed to be true.  This may cause
  231.       the wrong #_i_n_c_l_u_d_e directives    to be evaluated.
  232.  
  233.       Imagine you are parsing two files, say _f_i_l_e_1._c and _f_i_l_e_2._c,
  234.       each includes    the file _d_e_f._h.    The list of files that _d_e_f._h
  235.       includes might truly be different when _d_e_f._h is included by
  236.       _f_i_l_e_1._c than when it is included by _f_i_l_e_2._c. But once
  237.       mmmmaaaakkkkeeeeddddeeeeppppeeeennnndddd arrives at    a list of dependencies for a file, it
  238.       is cast in concrete.
  239.  
  240.      AAAAUUUUTTTTHHHHOOOORRRR
  241.       Todd Brunhoff, Tektronix, Inc. and MIT Project Athena
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.      Page 4                          (printed 6/9/98)
  263.  
  264.  
  265.  
  266.